<?php
class LoginService
{
	private $userName;
	private $passWord;
	/**
	 * 登陆验证
	 * @Author   Leikes
	 * @DateTime 2016-01-08T17:34:08+0800
	 * @return   array                   错误代码
	 */
	public function loginCheck()
	{
		if(!isset($this->userName)){
			return CMSException::$infoErr;
		}
		if(!isset($this->passWord)){
			return CMSException::$infoErr;
		}
		if (!Auth::attempt(array('username' => $this->userName, 'password' => $this->passWord)))
		{
			return CMSException::$loginErr;
		}
		return CMSException::$ok;
	}

	public function setUserName($userName)
	{
		$this->userName=trim($userName);
	}

	public function setPassWord($passWord)
	{
		$this->passWord=trim($passWord);
	}
}
?>